﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using DAL;
using Entities;
namespace BAL
{
    public class SanPhamBus
    {
        //get san pham theo ngay cap nhat moi nhat
        public DataTable getAllSanPham()
        {
            DataTable dt = new DataTable();
            dt = DBConnection.getALL("sp_getAllSanPham");
            return dt;
        }
        // get san pham theo gia cao nhat
        public DataTable getAllSanPham2()
        {
            DataTable dt = new DataTable();
            dt = DBConnection.getALL("sp_getAllSanPhamSortDonGia");
            return dt;
        }
        // get san pham theo ma nha san pham
        public DataTable getAllSanPham3(string MaNSX)
        {
            string mansx = MaNSX; 
            SqlParameter[] ThamSo = new SqlParameter[]
            {
            new SqlParameter("MaNSX",mansx),
            };
            DataTable dt = DBConnection.GetDatatableByStoreProcedureName("sp_getSanPhambyMaNSX", ThamSo);
            return dt;
        }
        

    }
}
